home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / AGNUS / SRC / OC_TEST / MODULE.M < prev    next >
Encoding:
Text File  |  1998-02-27  |  600 b   |  44 lines

  1. /*
  2.     EXAMPLE 5: module.m -- ObjC-Application to demonstrate usage of mult. files
  3. */
  4.  
  5. #include <oc.h>
  6. #include "module.h"    
  7. #include "d_module.h"
  8.  
  9.  
  10. IMPORT Ok start_(int argc, char **argv);
  11.  
  12. void main(
  13. int    argc,
  14. char **argv)
  15. {
  16.     if (obj_initall_())
  17.     {
  18.         start_(argc, argv);
  19.         obj_uninitall_();
  20.     }
  21. }
  22.  
  23. Ok start_(
  24. int    argc,
  25. char **argv)
  26. {
  27.     Obj    cstr = $new(Cstr);
  28.     Obj    pstr = $new(Pstr);
  29.  
  30.     $$cpy(cstr, "Abracadabra!\n");
  31.     $$ocpy(pstr, cstr);
  32.     $$print(pstr);
  33.     
  34.     $free(cstr);
  35.     $free(pstr);
  36.  
  37. #ifdef SYSTEM_OS2
  38.     { char inp[10]; printf("Please press <Return> to quit application!"); gets(inp); }
  39. #endif
  40.     DONE;
  41. }
  42.  
  43.  
  44.